<html>
<head>
    <title>Recorder.js Source Code | Sencha Test 1.0.3</title>
    <!--  Generated on  -->
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="css/styles.css">
</head>
<body>
    <pre class="editor editor-colors"><div class="line"><a name="line1"><span class="source js"><span class="comment block documentation js"><span class="punctuation definition comment js"><span>/**</span></span></span></span></div><div class="line"><a name="line2"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@class</span></span><span>&nbsp;ST.event.Recorder</span></span></span></div><div class="line"><a name="line3"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;@extend&nbsp;ST.event.Driver</span></span></span></div><div class="line"><a name="line4"><a name="ST.event.Recorder"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;This&nbsp;class&nbsp;is&nbsp;not&nbsp;created&nbsp;by&nbsp;user&nbsp;code.&nbsp;It&nbsp;is&nbsp;created&nbsp;by&nbsp;the&nbsp;Sencha&nbsp;Test&nbsp;Event&nbsp;Recorder</span></span></span></div><div class="line"><a name="line5"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;in&nbsp;Sencha&nbsp;Studio&nbsp;via&nbsp;the&nbsp;injected&nbsp;{@link&nbsp;ST#startRecording}&nbsp;method&nbsp;call.</span></span></span></div><div class="line"><a name="line6"><span class="source js"><span class="comment block documentation js"><span>&nbsp;</span><span class="punctuation definition comment js"><span>*/</span></span></span></span></div><div class="line"><a name="line7"><span class="source js"><span class="constant other object js"><span>ST</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant dom js"><span>event</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>Recorder</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="constant other object js"><span>ST</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>define</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line8"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;extend</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;</span><span class="constant other object js"><span>ST</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant dom js"><span>event</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>Driver</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line9"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line10"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;statics</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line11"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strategies</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;</span><span class="meta brace square js"><span>[</span></span></span></span></span></div><div class="line"><a name="line12"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta class instance constructor"><span class="keyword operator new js"><span>new</span></span><span>&nbsp;</span><span class="entity name type instance js"><span>ST.locator</span></span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>Strategy</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span></span></span></span></div><div class="line"><a name="line13"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace square js"><span>]</span></span></span></span></span></div><div class="line"><a name="line14"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line15"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line16"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment block documentation js"><span class="punctuation definition comment js"><span>/**</span></span></span></span></span></span></div><div class="line"><a name="line17"><a name="ST.event.Recorder-event-add"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@event</span></span><span>&nbsp;add</span></span></span></span></span></div><div class="line"><a name="line18"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Fires&nbsp;when&nbsp;events&nbsp;are&nbsp;added&nbsp;to&nbsp;the&nbsp;recording.</span></span></span></span></span></div><div class="line"><a name="line19"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;{ST.event.Recorder}&nbsp;this</span></span></span></span></span></div><div class="line"><a name="line20"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;{ST.event.Event[]}&nbsp;events</span></span></span></span></span></div><div class="line"><a name="line21"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="punctuation definition comment js"><span>*/</span></span></span></span></span></span></div><div class="line"><a name="line22"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line23"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment block documentation js"><span class="punctuation definition comment js"><span>/**</span></span></span></span></span></span></div><div class="line"><a name="line24"><a name="ST.event.Recorder-cfg-scrollThreshold"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@cfg&nbsp;</span><span class="other meta jsdoc"><span class="entity name type instance jsdoc"><span>{Number}</span></span><span>&nbsp;</span><span class="variable other jsdoc"><span>scrollThreshold</span></span><span>&nbsp;</span></span></span></span></span></span></div><div class="line"><a name="line25"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;if&nbsp;a&nbsp;&quot;scroll&quot;&nbsp;event&nbsp;occurs&nbsp;within&nbsp;this&nbsp;many&nbsp;milliseconds&nbsp;after&nbsp;a&nbsp;wheel,&nbsp;touchmove,</span></span></span></span></span></div><div class="line"><a name="line26"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;or&nbsp;pointermove&nbsp;with&nbsp;pointerType&nbsp;==&nbsp;&#39;touch&#39;&nbsp;within&nbsp;the&nbsp;same&nbsp;element,&nbsp;the&nbsp;wheel,</span></span></span></span></span></div><div class="line"><a name="line27"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;touchmove&nbsp;or&nbsp;pointermove&nbsp;event&nbsp;will&nbsp;be&nbsp;removed&nbsp;from&nbsp;the&nbsp;recording.&nbsp;&nbsp;The&nbsp;scroll&nbsp;event</span></span></span></span></span></div><div class="line"><a name="line28"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;is&nbsp;all&nbsp;we&nbsp;need&nbsp;for&nbsp;playback&nbsp;-&nbsp;playing&nbsp;back&nbsp;both&nbsp;the&nbsp;scroll&nbsp;event&nbsp;and&nbsp;the&nbsp;event&nbsp;that</span></span></span></span></span></div><div class="line"><a name="line29"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;triggered&nbsp;the&nbsp;scroll&nbsp;could&nbsp;cause&nbsp;more&nbsp;scrolling&nbsp;than&nbsp;desired.</span></span></span></span></span></div><div class="line"><a name="line30"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="punctuation definition comment js"><span>*/</span></span></span></span></span></span></div><div class="line"><a name="line31"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;scrollThreshold</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;</span><span class="constant numeric decimal js"><span>300</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line32"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line33"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment block documentation js"><span class="punctuation definition comment js"><span>/**</span></span></span></span></span></span></div><div class="line"><a name="line34"><a name="ST.event.Recorder-cfg-throttle"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@cfg&nbsp;</span><span class="other meta jsdoc"><span class="entity name type instance jsdoc"><span>{Number}</span></span><span>&nbsp;</span><span class="variable other jsdoc"><span>throttle</span></span><span>&nbsp;</span></span></span></span></span></span></div><div class="line"><a name="line35"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Number&nbsp;of&nbsp;milliseconds&nbsp;to&nbsp;use&nbsp;for&nbsp;throttling&nbsp;events&nbsp;(only&nbsp;events&nbsp;contained&nbsp;in</span></span></span></span></span></div><div class="line"><a name="line36"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;`throttledEvents`&nbsp;are&nbsp;eligible&nbsp;for&nbsp;throttling).</span></span></span></span></span></div><div class="line"><a name="line37"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Set&nbsp;to&nbsp;`0`&nbsp;to&nbsp;disable&nbsp;throttling&nbsp;and&nbsp;add&nbsp;all&nbsp;events&nbsp;to&nbsp;the&nbsp;recording.</span></span></span></span></span></div><div class="line"><a name="line38"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Only&nbsp;consecutive&nbsp;events&nbsp;of&nbsp;the&nbsp;same&nbsp;type&nbsp;are&nbsp;throttled.&nbsp;This&nbsp;approach&nbsp;ensures</span></span></span></span></span></div><div class="line"><a name="line39"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;consistency&nbsp;when&nbsp;interleaving&nbsp;mousemove/mouseover/mouseout&nbsp;events&nbsp;-&nbsp;for&nbsp;example&nbsp;a</span></span></span></span></span></div><div class="line"><a name="line40"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;mouseout&nbsp;would&nbsp;always&nbsp;be&nbsp;preceded&nbsp;by&nbsp;a&nbsp;mousemove,&nbsp;even&nbsp;if&nbsp;the&nbsp;throttling&nbsp;threshold</span></span></span></span></span></div><div class="line"><a name="line41"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;had&nbsp;not&nbsp;yet&nbsp;been&nbsp;reached.</span></span></span></span></span></div><div class="line"><a name="line42"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="punctuation definition comment js"><span>*/</span></span></span></span></span></span></div><div class="line"><a name="line43"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;throttle</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;</span><span class="constant numeric decimal js"><span>200</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line44"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line45"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment block documentation js"><span class="punctuation definition comment js"><span>/**</span></span></span></span></span></span></div><div class="line"><a name="line46"><a name="ST.event.Recorder-cfg-throttledEvents"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@cfg&nbsp;</span><span class="other meta jsdoc"><span class="entity name type instance jsdoc"><span>{Object}</span></span><span>&nbsp;</span><span class="variable other jsdoc"><span>throttledEvents</span></span><span>&nbsp;</span></span></span></span></span></span></div><div class="line"><a name="line47"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;High-frequency&nbsp;events&nbsp;that&nbsp;should&nbsp;be&nbsp;throttled&nbsp;during&nbsp;recording&nbsp;(if&nbsp;`throttle&nbsp;&gt;&nbsp;0`)</span></span></span></span></span></div><div class="line"><a name="line48"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="punctuation definition comment js"><span>*/</span></span></span></span></span></span></div><div class="line"><a name="line49"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;throttledEvents</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line50"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mousemove</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;</span><span class="constant numeric decimal js"><span>1</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line51"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;touchmove</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;</span><span class="constant numeric decimal js"><span>1</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line52"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pointermove</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;</span><span class="constant numeric decimal js"><span>1</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line53"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MSPointerMove</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;</span><span class="constant numeric decimal js"><span>1</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line54"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;scroll</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;</span><span class="constant numeric decimal js"><span>1</span></span></span></span></span></div><div class="line"><a name="line55"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line56"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line57"><a name="ST.event.Recorder-property-blockedPointerEvents"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment block documentation js"><span class="punctuation definition comment js"><span>/**</span></span></span></span></span></span></div><div class="line"><a name="line58"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;In&nbsp;browsers&nbsp;that&nbsp;implement&nbsp;pointerevents&nbsp;when&nbsp;a&nbsp;pointerdown&nbsp;is&nbsp;triggered&nbsp;by&nbsp;touching</span></span></span></span></span></div><div class="line"><a name="line59"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;the&nbsp;screen,&nbsp;pointerover&nbsp;and&nbsp;pointerenter&nbsp;events&nbsp;will&nbsp;be&nbsp;fired&nbsp;immmediately&nbsp;before</span></span></span></span></span></div><div class="line"><a name="line60"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;the&nbsp;pointerdown.&nbsp;&nbsp;When&nbsp;a&nbsp;pointerup&nbsp;is&nbsp;triggered&nbsp;by&nbsp;a&nbsp;touch,&nbsp;pointerout&nbsp;and&nbsp;pointerleave</span></span></span></span></span></div><div class="line"><a name="line61"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;events&nbsp;are&nbsp;fired&nbsp;imediatetely&nbsp;after.</span></span></span></span></span></div><div class="line"><a name="line62"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;We&nbsp;block&nbsp;pointerover,&nbsp;pointerout,&nbsp;pointerenter,&nbsp;and&nbsp;pointerleave,&nbsp;from&nbsp;being&nbsp;recorded</span></span></span></span></span></div><div class="line"><a name="line63"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;when&nbsp;trigered&nbsp;by&nbsp;touch&nbsp;input,&nbsp;since&nbsp;it&nbsp;is&nbsp;not&nbsp;likely&nbsp;the&nbsp;user&nbsp;intended&nbsp;to&nbsp;record&nbsp;these.</span></span></span></span></span></div><div class="line"><a name="line64"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Note:&nbsp;this&nbsp;only&nbsp;affects&nbsp;events&nbsp;with&nbsp;pointerType&nbsp;===&nbsp;&#39;touch&#39;&nbsp;or&nbsp;pointerType&nbsp;===&nbsp;&#39;pen&#39;,</span></span></span></span></span></div><div class="line"><a name="line65"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;we&nbsp;do&nbsp;NOT&nbsp;want&nbsp;to&nbsp;block&nbsp;these&nbsp;events&nbsp;when&nbsp;triggered&nbsp;using&nbsp;a&nbsp;mouse.</span></span></span></span></span></div><div class="line"><a name="line66"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;See&nbsp;also:</span></span></span></span></span></div><div class="line"><a name="line67"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="markup underline link http hyperlink"><span>http://www.w3.org/TR/pointerevents/#the-pointerdown-event</span></span></span></span></span></span></div><div class="line"><a name="line68"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="markup underline link http hyperlink"><span>http://www.w3.org/TR/pointerevents/#the-pointerenter-event</span></span></span></span></span></span></div><div class="line"><a name="line69"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@private</span></span></span></span></span></span></div><div class="line"><a name="line70"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="punctuation definition comment js"><span>*/</span></span></span></span></span></span></div><div class="line"><a name="line71"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;blockedPointerEvents</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line72"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pointerover</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;</span><span class="constant numeric decimal js"><span>1</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line73"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pointerout</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;</span><span class="constant numeric decimal js"><span>1</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line74"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pointerenter</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;</span><span class="constant numeric decimal js"><span>1</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line75"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pointerleave</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;</span><span class="constant numeric decimal js"><span>1</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line76"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MSPointerOver</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;</span><span class="constant numeric decimal js"><span>1</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line77"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MSPointerOut</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;</span><span class="constant numeric decimal js"><span>1</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line78"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MSPointerEnter</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;</span><span class="constant numeric decimal js"><span>1</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line79"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;MSPointerLeave</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;</span><span class="constant numeric decimal js"><span>1</span></span></span></span></span></div><div class="line"><a name="line80"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line81"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line82"><a name="ST.event.Recorder-property-documentEvents"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment block documentation js"><span class="punctuation definition comment js"><span>/**</span></span></span></span></span></span></div><div class="line"><a name="line83"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;To&nbsp;ensure&nbsp;we&nbsp;do&nbsp;not&nbsp;miss&nbsp;any&nbsp;events&nbsp;that&nbsp;may&nbsp;have&nbsp;been&nbsp;canceled&nbsp;by&nbsp;user&nbsp;code&nbsp;we&nbsp;want</span></span></span></span></span></div><div class="line"><a name="line84"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;to&nbsp;capture&nbsp;the&nbsp;event&nbsp;at&nbsp;the&nbsp;highest&nbsp;level&nbsp;possible.&nbsp;&nbsp;Most&nbsp;events&nbsp;can&nbsp;be&nbsp;captured&nbsp;at</span></span></span></span></span></div><div class="line"><a name="line85"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;the&nbsp;window&nbsp;object,&nbsp;but&nbsp;some&nbsp;events&nbsp;must&nbsp;be&nbsp;captured&nbsp;at&nbsp;the&nbsp;document&nbsp;level.</span></span></span></span></span></div><div class="line"><a name="line86"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@private</span></span></span></span></span></span></div><div class="line"><a name="line87"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="punctuation definition comment js"><span>*/</span></span></span></span></span></span></div><div class="line"><a name="line88"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;documentEvents</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line89"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mouseenter</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;</span><span class="constant numeric decimal js"><span>1</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line90"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;mouseleave</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;</span><span class="constant numeric decimal js"><span>1</span></span></span></span></span></div><div class="line"><a name="line91"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line92"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line93"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta function json js"><span class="entity name function js"><span>constructor</span></span><span class="keyword operator assignment js"><span>:</span></span><span>&nbsp;</span><span class="storage type function js"><span>function</span></span><span>&nbsp;</span><span class="meta parameters js"><span class="punctuation definition parameters begin bracket round js"><span>(</span></span><span class="variable parameter function js"><span>config</span></span><span class="punctuation definition parameters end bracket round js"><span>)</span></span></span></span><span>&nbsp;</span><span class="punctuation definition function body begin bracket curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line94"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="storage type var js"><span>var</span></span><span>&nbsp;me&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable language js"><span>this</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line95"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Event&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="constant other object js"><span>ST</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant dom js"><span>event</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>Event</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line96"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;supports&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="constant other object js"><span>ST</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>supports</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line97"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;eventMaps&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>eventMaps</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="meta brace square js"><span>[</span></span></span></span></span></div><div class="line"><a name="line98"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>Event</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>clickEvents</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line99"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>Event</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>focusEvents</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line100"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line101"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;We&nbsp;intentionally&nbsp;do&nbsp;not&nbsp;record&nbsp;keypress&nbsp;so&nbsp;as&nbsp;to&nbsp;simplify&nbsp;the&nbsp;output.</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line102"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;When&nbsp;a&nbsp;keydown&nbsp;event&nbsp;is&nbsp;played&nbsp;back,&nbsp;a&nbsp;keypress&nbsp;will&nbsp;be&nbsp;simulated</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line103"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;immediately&nbsp;after.</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line104"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;keydown</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;</span><span class="constant numeric decimal js"><span>1</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line105"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;keyup</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;</span><span class="constant numeric decimal js"><span>1</span></span></span></span></span></div><div class="line"><a name="line106"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line107"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace square js"><span>]</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line108"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line109"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span class="variable other object js"><span>supports</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>PointerEvents</span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line110"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>eventMaps</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="support function js"><span>push</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="variable other object js"><span>Event</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>pointerEvents</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span><span>&nbsp;</span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;IE11/Edge</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line111"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span><span>&nbsp;</span><span class="keyword control js"><span>else</span></span><span>&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span class="variable other object js"><span>supports</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>MSPointerEvents</span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line112"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>eventMaps</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="support function js"><span>push</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="variable other object js"><span>Event</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>msPointerEvents</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span><span>&nbsp;</span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;IE10</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line113"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span><span>&nbsp;</span><span class="keyword control js"><span>else</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line114"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span class="variable other object js"><span>supports</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>TouchEvents</span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line115"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>eventMaps</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="support function js"><span>push</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="variable other object js"><span>Event</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>touchEvents</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line116"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line117"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>eventMaps</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="support function js"><span>push</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="variable other object js"><span>Event</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>mouseEvents</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line118"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line119"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line120"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="constant other object js"><span>ST</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="support function js"><span>apply</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>me</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;config</span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line121"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line122"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant dom js"><span>clear</span></span><span class="meta brace round js"><span>(</span><span>)</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line123"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="punctuation definition function body end bracket curly js"><span>}</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line124"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line125"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta function json js"><span class="entity name function js"><span>clear</span></span><span class="keyword operator assignment js"><span>:</span></span><span>&nbsp;</span><span class="storage type function js"><span>function</span></span><span>&nbsp;</span><span class="meta parameters js"><span class="punctuation definition parameters begin bracket round js"><span>(</span></span><span class="punctuation definition parameters end bracket round js"><span>)</span></span></span></span><span>&nbsp;</span><span class="punctuation definition function body begin bracket curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line126"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="storage type var js"><span>var</span></span><span>&nbsp;me&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable language js"><span>this</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line127"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>recording</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="meta brace square js"><span>[</span><span>]</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line128"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>flushIndex</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="constant numeric decimal js"><span>0</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line129"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>lastTouchEndTime</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>lastTouchStartX</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>lastTouchStartY</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="constant language null js"><span>null</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line130"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="punctuation definition function body end bracket curly js"><span>}</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line131"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line132"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta function json js"><span class="entity name function js"><span>addListener</span></span><span class="keyword operator assignment js"><span>:</span></span><span>&nbsp;</span><span class="storage type function js"><span>function</span></span><span>&nbsp;</span><span class="meta parameters js"><span class="punctuation definition parameters begin bracket round js"><span>(</span></span><span class="support class js"><span>event</span></span><span class="punctuation definition parameters end bracket round js"><span>)</span></span></span></span><span>&nbsp;</span><span class="punctuation definition function body begin bracket curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line133"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="storage type var js"><span>var</span></span><span>&nbsp;me&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable language js"><span>this</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line134"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;target&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>documentEvents</span></span><span class="meta brace square js"><span>[</span></span><span class="support class js"><span>event</span></span><span class="meta brace square js"><span>]</span></span><span>&nbsp;</span><span class="keyword operator js"><span>?</span></span><span>&nbsp;</span><span class="support class js"><span>document</span></span><span>&nbsp;</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;</span><span class="support class js"><span>window</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line135"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line136"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other object property js"><span>listeners</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="support function js"><span>push</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="constant other object js"><span>ST</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other object property js"><span>Element</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>on</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>target</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="support class js"><span>event</span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>onEvent</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;me</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="constant language boolean true js"><span>true</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line137"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="punctuation definition function body end bracket curly js"><span>}</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line138"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line139"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta function json js"><span class="entity name function js"><span>onEvent</span></span><span class="keyword operator assignment js"><span>:</span></span><span>&nbsp;</span><span class="storage type function js"><span>function</span></span><span class="meta parameters js"><span class="punctuation definition parameters begin bracket round js"><span>(</span></span><span class="variable parameter function js"><span>ev</span></span><span class="punctuation definition parameters end bracket round js"><span>)</span></span></span></span><span>&nbsp;</span><span class="punctuation definition function body begin bracket curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line140"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="storage type var js"><span>var</span></span><span>&nbsp;me&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable language js"><span>this</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line141"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;type&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>ev</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant dom js"><span>type</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line142"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;isScroll&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>type&nbsp;</span><span class="keyword operator comparison js"><span>===</span></span><span>&nbsp;</span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>scroll</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span class="meta brace round js"><span>)</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line143"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;time</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;e</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;touches</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;touch</span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line144"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line145"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;Don&#39;t&nbsp;process&nbsp;dom&nbsp;scroll&nbsp;event&nbsp;if&nbsp;we&nbsp;already&nbsp;are&nbsp;receiving&nbsp;scroll&nbsp;events</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line146"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;from&nbsp;a&nbsp;Ext.scroll.Scroller&nbsp;associated&nbsp;with&nbsp;this&nbsp;element.</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line147"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span class="keyword operator logical js"><span>!</span></span><span>isScroll&nbsp;</span><span class="keyword operator logical js"><span>||</span></span><span>&nbsp;</span><span class="keyword operator logical js"><span>!</span></span><span class="constant other object js"><span>ST</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>fly</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="variable other object js"><span>ev</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant dom js"><span>target</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>getScroller</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line148"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;time&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>getTimestamp</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line149"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>wrapEvent</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>ev</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;time</span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line150"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line151"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span class="keyword operator logical js"><span>!</span></span><span class="variable other object js"><span>me</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>isEventBlocked</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>e</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;time</span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span>&nbsp;</span><span class="keyword operator logical js"><span>&amp;&amp;</span></span><span>&nbsp;</span><span class="keyword operator logical js"><span>!</span></span><span class="variable other object js"><span>me</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>doThrottle</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>e</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;time</span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line152"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other object property js"><span>recording</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="support function js"><span>push</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>e</span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line153"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line154"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>isScroll</span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line155"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>clearScrollSource</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>e</span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line156"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>flush</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line157"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span><span>&nbsp;</span><span class="keyword control js"><span>else</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line158"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta function-call js"><span class="support function js"><span>clearTimeout</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>flushTimeout</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line159"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>flushTimeout</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="meta function-call js"><span class="support function js"><span>setTimeout</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="meta function js"><span class="storage type function js"><span>function</span></span><span class="meta parameters js"><span class="punctuation definition parameters begin bracket round js"><span>(</span></span><span class="punctuation definition parameters end bracket round js"><span>)</span></span></span></span><span>&nbsp;</span><span class="punctuation definition function body begin bracket curly js"><span>{</span></span></span></span></span></span></span></div><div class="line"><a name="line160"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="meta function-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>flush</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></span></span></div><div class="line"><a name="line161"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="meta function-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="punctuation definition function body end bracket curly js"><span>}</span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>scrollThreshold</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line162"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line163"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line164"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>type&nbsp;</span><span class="keyword operator comparison js"><span>===</span></span><span>&nbsp;</span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>touchstart</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line165"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;touches&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>ev</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>touches</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line166"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line167"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span class="variable other object js"><span>touches</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant js"><span>length</span></span><span>&nbsp;</span><span class="keyword operator comparison js"><span>===</span></span><span>&nbsp;</span><span class="constant numeric decimal js"><span>1</span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line168"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;capture&nbsp;the&nbsp;coordinates&nbsp;of&nbsp;the&nbsp;first&nbsp;touchstart&nbsp;event&nbsp;so&nbsp;we&nbsp;can&nbsp;use</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line169"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;them&nbsp;to&nbsp;eliminate&nbsp;duplicate&nbsp;mouse&nbsp;events&nbsp;if&nbsp;needed,&nbsp;(see&nbsp;isEventBlocked).</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line170"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;touch&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;touches</span><span class="meta brace square js"><span>[</span></span><span class="constant numeric decimal js"><span>0</span></span><span class="meta brace square js"><span>]</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line171"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>lastTouchStartX</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>touch</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant js"><span>pageX</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line172"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>lastTouchStartY</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>touch</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant js"><span>pageY</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line173"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line174"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span><span>&nbsp;</span><span class="keyword control js"><span>else</span></span><span>&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>type&nbsp;</span><span class="keyword operator comparison js"><span>===</span></span><span>&nbsp;</span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>touchend</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line175"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;Capture&nbsp;a&nbsp;time&nbsp;stamp&nbsp;so&nbsp;we&nbsp;can&nbsp;use&nbsp;it&nbsp;to&nbsp;eliminate&nbsp;potential&nbsp;duplicate</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line176"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;emulated&nbsp;mouse&nbsp;events&nbsp;on&nbsp;multi-input&nbsp;devices&nbsp;that&nbsp;have&nbsp;touch&nbsp;events,</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line177"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;e.g.&nbsp;Chrome&nbsp;on&nbsp;Window8&nbsp;with&nbsp;touch-screen&nbsp;(see&nbsp;isEventBlocked).</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line178"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>lastTouchEndTime</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;time</span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line179"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line180"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line181"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line182"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="punctuation definition function body end bracket curly js"><span>}</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line183"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line184"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta function json js"><span class="entity name function js"><span>flush</span></span><span class="keyword operator assignment js"><span>:</span></span><span>&nbsp;</span><span class="storage type function js"><span>function</span></span><span class="meta parameters js"><span class="punctuation definition parameters begin bracket round js"><span>(</span></span><span class="punctuation definition parameters end bracket round js"><span>)</span></span></span></span><span>&nbsp;</span><span class="punctuation definition function body begin bracket curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line185"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="storage type var js"><span>var</span></span><span>&nbsp;me&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable language js"><span>this</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line186"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;recording&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>recording</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line187"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;length&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>recording</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant js"><span>length</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line188"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line189"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>fireEvent</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>add</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;me</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="variable other object js"><span>recording</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="support function js"><span>slice</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>flushIndex</span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;length</span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line190"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>flushIndex</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;length</span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line191"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta function-call js"><span class="support function js"><span>clearTimeout</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>flushTimeout</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line192"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>flushTimeout</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="constant language null js"><span>null</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line193"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="punctuation definition function body end bracket curly js"><span>}</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line194"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line195"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta function json js"><span class="entity name function js"><span>doThrottle</span></span><span class="keyword operator assignment js"><span>:</span></span><span>&nbsp;</span><span class="storage type function js"><span>function</span></span><span class="meta parameters js"><span class="punctuation definition parameters begin bracket round js"><span>(</span></span><span class="variable parameter function js"><span>e</span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="variable parameter function js"><span>time</span></span><span class="punctuation definition parameters end bracket round js"><span>)</span></span></span></span><span>&nbsp;</span><span class="punctuation definition function body begin bracket curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line196"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="storage type var js"><span>var</span></span><span>&nbsp;me&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable language js"><span>this</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line197"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throttled&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="constant language boolean false js"><span>false</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line198"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lastThrottledEvent&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>lastThrottledEvent</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line199"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;recording&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>recording</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line200"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throttle&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>throttle</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line201"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;type&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>e</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant dom js"><span>type</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line202"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lastEvent</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;timeElapsed</span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line203"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line204"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>throttle</span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line205"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lastEvent&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;recording</span><span class="meta brace square js"><span>[</span></span><span class="variable other object js"><span>recording</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant js"><span>length</span></span><span>&nbsp;</span><span class="keyword operator js"><span>-</span></span><span>&nbsp;</span><span class="constant numeric decimal js"><span>1</span></span><span class="meta brace square js"><span>]</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line206"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line207"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>lastEvent</span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line208"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta function-call js"><span class="support function js"><span>clearTimeout</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>throttleTimeout</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line209"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line210"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span class="variable other object js"><span>lastEvent</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant dom js"><span>type</span></span><span>&nbsp;</span><span class="keyword operator comparison js"><span>===</span></span><span>&nbsp;type</span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line211"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>throttledEvents</span></span><span class="meta brace square js"><span>[</span></span><span>type</span><span class="meta brace square js"><span>]</span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line212"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;timeElapsed&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;time&nbsp;</span><span class="keyword operator js"><span>-</span></span><span>&nbsp;</span><span class="variable other object js"><span>lastEvent</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>time</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line213"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line214"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>timeElapsed&nbsp;</span><span class="keyword operator comparison js"><span>&lt;</span></span><span>&nbsp;throttle</span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line215"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>lastThrottledEvent</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;e</span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line216"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line217"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>throttleTimeout</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="meta function-call js"><span class="support function js"><span>setTimeout</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="meta function js"><span class="storage type function js"><span>function</span></span><span class="meta parameters js"><span class="punctuation definition parameters begin bracket round js"><span>(</span></span><span class="punctuation definition parameters end bracket round js"><span>)</span></span></span></span><span>&nbsp;</span><span class="punctuation definition function body begin bracket curly js"><span>{</span></span></span></span></span></span></span></div><div class="line"><a name="line218"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="meta function-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>recording</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="support function js"><span>push</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>lastThrottledEvent</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></span></span></div><div class="line"><a name="line219"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="meta function-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>lastThrottledEvent</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="constant language null js"><span>null</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></span></span></div><div class="line"><a name="line220"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="meta function-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span class="keyword operator logical js"><span>!</span></span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>flushTimeout</span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></span></span></div><div class="line"><a name="line221"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="meta function-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>flush</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></span></span></div><div class="line"><a name="line222"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="meta function-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></span></span></div><div class="line"><a name="line223"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="meta function-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="punctuation definition function body end bracket curly js"><span>}</span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;throttle&nbsp;</span><span class="keyword operator js"><span>-</span></span><span>&nbsp;timeElapsed</span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line224"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line225"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throttled&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="constant language boolean true js"><span>true</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line226"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line227"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line228"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span><span>&nbsp;</span><span class="keyword control js"><span>else</span></span><span>&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>lastThrottledEvent</span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line229"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>recording</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="support function js"><span>push</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>lastThrottledEvent</span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line230"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>lastThrottledEvent</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="constant language null js"><span>null</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line231"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line232"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line233"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line234"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line235"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>return</span></span><span>&nbsp;throttled</span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line236"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="punctuation definition function body end bracket curly js"><span>}</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line237"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line238"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta function json js"><span class="entity name function js"><span>onScrollerScroll</span></span><span class="keyword operator assignment js"><span>:</span></span><span>&nbsp;</span><span class="storage type function js"><span>function</span></span><span class="meta parameters js"><span class="punctuation definition parameters begin bracket round js"><span>(</span></span><span class="variable parameter function js"><span>scroller</span></span><span class="punctuation definition parameters end bracket round js"><span>)</span></span></span></span><span>&nbsp;</span><span class="punctuation definition function body begin bracket curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line239"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="storage type var js"><span>var</span></span><span>&nbsp;me&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable language js"><span>this</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line240"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;5.0&nbsp;getContainer(),&nbsp;5.1+&nbsp;getElement()</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line241"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;target&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span class="variable other object js"><span>scroller</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>getContainer</span></span><span>&nbsp;</span><span class="keyword operator js"><span>?</span></span><span>&nbsp;</span><span class="variable other object js"><span>scroller</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>getContainer</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span>&nbsp;</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;</span><span class="variable other object js"><span>scroller</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>getElement</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="meta brace round js"><span>)</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>dom</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line242"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;time&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>getTimestamp</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line243"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;e&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>wrapEvent</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="meta brace curly js"><span>{</span></span></span></span></span></span></span></div><div class="line"><a name="line244"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;type</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;</span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>scroll</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></span></span></div><div class="line"><a name="line245"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;target</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;target</span></span></span></span></span></span></div><div class="line"><a name="line246"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;time</span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line247"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line248"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>doThrottle</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>e</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;time</span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line249"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other object property js"><span>recording</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="support function js"><span>push</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>e</span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line250"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>clearScrollSource</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>e</span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line251"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>flush</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line252"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="punctuation definition function body end bracket curly js"><span>}</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line253"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line254"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta function json js"><span class="entity name function js"><span>wrapEvent</span></span><span class="keyword operator assignment js"><span>:</span></span><span>&nbsp;</span><span class="storage type function js"><span>function</span></span><span class="meta parameters js"><span class="punctuation definition parameters begin bracket round js"><span>(</span></span><span class="variable parameter function js"><span>e</span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="variable parameter function js"><span>time</span></span><span class="punctuation definition parameters end bracket round js"><span>)</span></span></span></span><span>&nbsp;</span><span class="punctuation definition function body begin bracket curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line255"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>return</span></span><span>&nbsp;</span><span class="meta class instance constructor"><span class="keyword operator new js"><span>new</span></span><span>&nbsp;</span><span class="entity name type instance js"><span>ST.event</span></span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>Event</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>e</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="variable language js"><span>this</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>locateElement</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="variable other object js"><span>e</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant dom js"><span>target</span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;e</span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;time</span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line256"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="punctuation definition function body end bracket curly js"><span>}</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line257"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line258"><a name="ST.event.Recorder-method-clearScrollSource"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment block documentation js"><span class="punctuation definition comment js"><span>/**</span></span></span></span></span></span></div><div class="line"><a name="line259"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Removes&nbsp;from&nbsp;the&nbsp;recording&nbsp;the&nbsp;source&nbsp;event(s)&nbsp;that&nbsp;triggered&nbsp;a&nbsp;scroll&nbsp;event</span></span></span></span></span></div><div class="line"><a name="line260"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;{ST.event.Event}&nbsp;scrollEvent&nbsp;The&nbsp;scroll&nbsp;event</span></span></span></span></span></div><div class="line"><a name="line261"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@private</span></span></span></span></span></span></div><div class="line"><a name="line262"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="punctuation definition comment js"><span>*/</span></span></span></span></span></span></div><div class="line"><a name="line263"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta function json js"><span class="entity name function js"><span>clearScrollSource</span></span><span class="keyword operator assignment js"><span>:</span></span><span>&nbsp;</span><span class="storage type function js"><span>function</span></span><span class="meta parameters js"><span class="punctuation definition parameters begin bracket round js"><span>(</span></span><span class="variable parameter function js"><span>scrollEvent</span></span><span class="punctuation definition parameters end bracket round js"><span>)</span></span></span></span><span>&nbsp;</span><span class="punctuation definition function body begin bracket curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line264"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="storage type var js"><span>var</span></span><span>&nbsp;recording&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable language js"><span>this</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>recording</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line265"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;i&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>recording</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant js"><span>length</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line266"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;scrollTime&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>scrollEvent</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>time</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line267"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="support class js"><span>event</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line268"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line269"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>while</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>i</span><span class="keyword operator decrement js"><span>--</span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line270"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="support class js"><span>event</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;recording</span><span class="meta brace square js"><span>[</span></span><span>i</span><span class="meta brace square js"><span>]</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line271"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;type&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="support class js"><span>event</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant dom js"><span>type</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line272"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line273"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span><span>(</span></span><span>scrollTime&nbsp;</span><span class="keyword operator js"><span>-</span></span><span>&nbsp;</span><span class="support class js"><span>event</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>time</span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="keyword operator comparison js"><span>&lt;</span></span><span>&nbsp;</span><span class="variable language js"><span>this</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>scrollThreshold</span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line274"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span><span>(</span><span>(</span></span><span>type&nbsp;</span><span class="keyword operator comparison js"><span>===</span></span><span>&nbsp;</span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>wheel</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="keyword operator logical js"><span>||</span></span></span></span></span></div><div class="line"><a name="line275"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace round js"><span>(</span></span><span class="constant other object js"><span>ST</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant dom js"><span>event</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other object property js"><span>Event</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>movementEvents</span></span><span class="meta brace square js"><span>[</span></span><span>type</span><span class="meta brace square js"><span>]</span></span><span>&nbsp;</span><span class="keyword operator logical js"><span>&amp;&amp;</span></span><span>&nbsp;</span><span class="support class js"><span>event</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>pointerType</span></span><span>&nbsp;</span><span class="keyword operator comparison js"><span>===</span></span><span>&nbsp;</span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>touch</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span class="meta brace round js"><span>)</span><span>)</span></span><span>&nbsp;</span><span class="keyword operator logical js"><span>&amp;&amp;</span></span></span></span></span></div><div class="line"><a name="line276"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>scrollEvent</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant dom js"><span>target</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>contains</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="support class js"><span>event</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant dom js"><span>target</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="meta brace round js"><span>)</span></span></span></span></span></div><div class="line"><a name="line277"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line278"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>recording</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="support function js"><span>splice</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>i</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="constant numeric decimal js"><span>1</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line279"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line280"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span><span>&nbsp;</span><span class="keyword control js"><span>else</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line281"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>break</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line282"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line283"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line284"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="punctuation definition function body end bracket curly js"><span>}</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line285"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line286"><a name="ST.event.Recorder-method-isEventBlocked"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="comment block documentation js"><span class="punctuation definition comment js"><span>/**</span></span></span></span></span></span></div><div class="line"><a name="line287"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Detects&nbsp;if&nbsp;the&nbsp;given&nbsp;event&nbsp;should&nbsp;be&nbsp;blocked&nbsp;from&nbsp;being&nbsp;recorded&nbsp;because&nbsp;it&nbsp;is&nbsp;a</span></span></span></span></span></div><div class="line"><a name="line288"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;emulated&nbsp;&quot;compatibility&quot;&nbsp;mouse&nbsp;event&nbsp;triggered&nbsp;by&nbsp;a&nbsp;touch&nbsp;on&nbsp;the&nbsp;screen,&nbsp;or&nbsp;an</span></span></span></span></span></div><div class="line"><a name="line289"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;emulated&nbsp;pointerover/out/enter/leave&nbsp;triggered&nbsp;by&nbsp;touch&nbsp;screen&nbsp;input.</span></span></span></span></span></div><div class="line"><a name="line290"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;{ST.event.Event}&nbsp;e</span></span></span></span></span></div><div class="line"><a name="line291"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;</span><span class="other meta jsdoc"><span class="entity name type instance jsdoc"><span>{Number}</span></span><span>&nbsp;</span><span class="variable other jsdoc"><span>now</span></span><span>&nbsp;</span><span class="other description jsdoc"><span>Current&nbsp;time&nbsp;stamp</span></span></span></span></span></span></span></div><div class="line"><a name="line292"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@return</span></span><span>&nbsp;{Boolean}</span></span></span></span></span></div><div class="line"><a name="line293"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@private</span></span></span></span></span></span></div><div class="line"><a name="line294"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="comment block documentation js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="punctuation definition comment js"><span>*/</span></span></span></span></span></span></div><div class="line"><a name="line295"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta function json js"><span class="entity name function js"><span>isEventBlocked</span></span><span class="keyword operator assignment js"><span>:</span></span><span>&nbsp;</span><span class="storage type function js"><span>function</span></span><span class="meta parameters js"><span class="punctuation definition parameters begin bracket round js"><span>(</span></span><span class="variable parameter function js"><span>e</span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="variable parameter function js"><span>now</span></span><span class="punctuation definition parameters end bracket round js"><span>)</span></span></span></span><span>&nbsp;</span><span class="punctuation definition function body begin bracket curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line296"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="storage type var js"><span>var</span></span><span>&nbsp;me&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable language js"><span>this</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line297"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;type&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>e</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant dom js"><span>type</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line298"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line299"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;Firefox&nbsp;emits&nbsp;keypress&nbsp;events&nbsp;even&nbsp;for&nbsp;keys&nbsp;that&nbsp;do&nbsp;not&nbsp;produce&nbsp;a&nbsp;character&nbsp;value.</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line300"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;These&nbsp;events&nbsp;always&nbsp;have&nbsp;charCode&nbsp;==&nbsp;0.&nbsp;&nbsp;Since&nbsp;no&nbsp;other&nbsp;browser&nbsp;does&nbsp;this</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line301"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;we&nbsp;filter&nbsp;these&nbsp;events&nbsp;out&nbsp;of&nbsp;the&nbsp;recording.</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line302"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>return</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>type&nbsp;</span><span class="keyword operator comparison js"><span>===</span></span><span>&nbsp;</span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>keypress</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span>&nbsp;</span><span class="keyword operator logical js"><span>&amp;&amp;</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span class="variable other object js"><span>e</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>charCode</span></span><span>&nbsp;</span><span class="keyword operator comparison js"><span>===</span></span><span>&nbsp;</span><span class="constant numeric decimal js"><span>0</span></span><span class="meta brace round js"><span>)</span><span>)</span></span><span>&nbsp;</span><span class="keyword operator logical js"><span>||</span></span></span></span></span></div><div class="line"><a name="line303"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line304"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;prevent&nbsp;emulated&nbsp;pointerover,&nbsp;pointerout,&nbsp;pointerenter,&nbsp;and&nbsp;pointerleave</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line305"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;events&nbsp;from&nbsp;being&nbsp;recorded&nbsp;when&nbsp;triggered&nbsp;by&nbsp;touching&nbsp;the&nbsp;screen.</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line306"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace round js"><span>(</span></span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>blockedPointerEvents</span></span><span class="meta brace square js"><span>[</span></span><span>type</span><span class="meta brace square js"><span>]</span></span><span>&nbsp;</span><span class="keyword operator logical js"><span>&amp;&amp;</span></span><span>&nbsp;</span><span class="variable other object js"><span>e</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>pointerType</span></span><span>&nbsp;</span><span class="keyword operator comparison js"><span>!==</span></span><span>&nbsp;</span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>mouse</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="keyword operator logical js"><span>||</span></span></span></span></span></div><div class="line"><a name="line307"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line308"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace round js"><span>(</span></span><span class="constant other object js"><span>ST</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other object property js"><span>supports</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>TouchEvents</span></span><span>&nbsp;</span><span class="keyword operator logical js"><span>&amp;&amp;</span></span><span>&nbsp;</span><span class="constant other object js"><span>ST</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant dom js"><span>event</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other object property js"><span>Event</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>mouseEvents</span></span><span class="meta brace square js"><span>[</span></span><span>type</span><span class="meta brace square js"><span>]</span></span><span>&nbsp;</span><span class="keyword operator logical js"><span>&amp;&amp;</span></span></span></span></span></div><div class="line"><a name="line309"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;some&nbsp;browsers&nbsp;(e.g.&nbsp;webkit&nbsp;on&nbsp;Windows&nbsp;8&nbsp;with&nbsp;touch&nbsp;screen)&nbsp;emulate&nbsp;mouse</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line310"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;events&nbsp;after&nbsp;touch&nbsp;events&nbsp;have&nbsp;fired.&nbsp;&nbsp;This&nbsp;only&nbsp;seems&nbsp;to&nbsp;happen&nbsp;when&nbsp;there</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line311"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;is&nbsp;no&nbsp;movement&nbsp;present,&nbsp;so,&nbsp;for&nbsp;example,&nbsp;a&nbsp;touchstart&nbsp;followed&nbsp;immediately</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line312"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;by&nbsp;a&nbsp;touchend&nbsp;would&nbsp;result&nbsp;in&nbsp;the&nbsp;following&nbsp;sequence&nbsp;of&nbsp;events:</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line313"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;&quot;touchstart,&nbsp;touchend,&nbsp;mousemove,&nbsp;mousedown,&nbsp;mouseup&quot;</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line314"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;yes,&nbsp;you&nbsp;read&nbsp;that&nbsp;right,&nbsp;the&nbsp;emulated&nbsp;mousemove&nbsp;fires&nbsp;before&nbsp;mousedown.</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line315"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;However,&nbsp;touch&nbsp;events&nbsp;with&nbsp;movement&nbsp;(touchstart,&nbsp;touchmove,&nbsp;then&nbsp;touchend)</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line316"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;do&nbsp;not&nbsp;trigger&nbsp;the&nbsp;emulated&nbsp;mouse&nbsp;events.</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line317"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;We&nbsp;cannot&nbsp;solve&nbsp;the&nbsp;problem&nbsp;by&nbsp;only&nbsp;listening&nbsp;for&nbsp;touch&nbsp;events&nbsp;and&nbsp;ignoring</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line318"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;mouse&nbsp;events,&nbsp;since&nbsp;we&nbsp;may&nbsp;be&nbsp;on&nbsp;a&nbsp;multi-input&nbsp;device&nbsp;that&nbsp;supports&nbsp;both</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line319"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;touch&nbsp;and&nbsp;mouse&nbsp;events&nbsp;and&nbsp;we&nbsp;want&nbsp;to&nbsp;record&nbsp;both&nbsp;kinds&nbsp;of&nbsp;events&nbsp;-&nbsp;touch</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line320"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;events&nbsp;when&nbsp;touching&nbsp;the&nbsp;screen&nbsp;and&nbsp;mouse&nbsp;event&nbsp;when&nbsp;using&nbsp;the&nbsp;mouse.</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line321"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;Instead&nbsp;we&nbsp;have&nbsp;to&nbsp;detect&nbsp;if&nbsp;the&nbsp;mouse&nbsp;event&nbsp;is&nbsp;an&nbsp;emulated&nbsp;mouse&nbsp;event&nbsp;by</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line322"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;checking&nbsp;if&nbsp;its&nbsp;coordinates&nbsp;are&nbsp;near&nbsp;the&nbsp;last&nbsp;touchstart&#39;s&nbsp;coordinates,</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line323"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;and&nbsp;if&nbsp;it&#39;s&nbsp;timestamp&nbsp;is&nbsp;within&nbsp;a&nbsp;certain&nbsp;threshold&nbsp;of&nbsp;the&nbsp;last&nbsp;touchend</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line324"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;event&#39;s&nbsp;timestamp.&nbsp;&nbsp;This&nbsp;is&nbsp;because&nbsp;when&nbsp;dealing&nbsp;with&nbsp;multi-touch&nbsp;events,</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line325"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;the&nbsp;emulated&nbsp;mousedown&nbsp;event&nbsp;(when&nbsp;it&nbsp;does&nbsp;fire)&nbsp;will&nbsp;fire&nbsp;with&nbsp;approximately</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line326"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;the&nbsp;same&nbsp;coordinates&nbsp;as&nbsp;the&nbsp;first&nbsp;touchstart,&nbsp;but&nbsp;within&nbsp;a&nbsp;short&nbsp;time&nbsp;after</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line327"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;the&nbsp;last&nbsp;touchend.&nbsp;&nbsp;We&nbsp;use&nbsp;15px&nbsp;as&nbsp;the&nbsp;distance&nbsp;threshold,&nbsp;to&nbsp;be&nbsp;on&nbsp;the&nbsp;safe</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line328"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;side&nbsp;because&nbsp;the&nbsp;observed&nbsp;difference&nbsp;in&nbsp;coordinates&nbsp;can&nbsp;sometimes&nbsp;be&nbsp;up&nbsp;to&nbsp;6px.</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line329"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="support class math js"><span>Math</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="support function math js"><span>abs</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="variable other object js"><span>e</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant js"><span>pageX</span></span><span>&nbsp;</span><span class="keyword operator js"><span>-</span></span><span>&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>lastTouchStartX</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span>&nbsp;</span><span class="keyword operator comparison js"><span>&lt;</span></span><span>&nbsp;</span><span class="constant numeric decimal js"><span>15</span></span><span>&nbsp;</span><span class="keyword operator logical js"><span>&amp;&amp;</span></span></span></span></span></div><div class="line"><a name="line330"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="support class math js"><span>Math</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="support function math js"><span>abs</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="variable other object js"><span>e</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant js"><span>pageY</span></span><span>&nbsp;</span><span class="keyword operator js"><span>-</span></span><span>&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>lastTouchStartY</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span>&nbsp;</span><span class="keyword operator comparison js"><span>&lt;</span></span><span>&nbsp;</span><span class="constant numeric decimal js"><span>15</span></span><span>&nbsp;</span><span class="keyword operator logical js"><span>&amp;&amp;</span></span></span></span></span></div><div class="line"><a name="line331"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line332"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;In&nbsp;the&nbsp;majority&nbsp;of&nbsp;cases,&nbsp;the&nbsp;emulated&nbsp;mousedown&nbsp;occurs&nbsp;within&nbsp;5ms&nbsp;of</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line333"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;touchend,&nbsp;however,&nbsp;to&nbsp;be&nbsp;certain&nbsp;we&nbsp;eliminate&nbsp;the&nbsp;emulated&nbsp;mouse&nbsp;event&nbsp;from</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line334"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;the&nbsp;recording&nbsp;we&nbsp;use&nbsp;a&nbsp;threshold&nbsp;of&nbsp;1000ms.&nbsp;&nbsp;The&nbsp;side&nbsp;effect&nbsp;of&nbsp;this&nbsp;is&nbsp;that</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line335"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;if&nbsp;a&nbsp;user&nbsp;touches&nbsp;the&nbsp;screen&nbsp;and&nbsp;then&nbsp;quickly&nbsp;clicks&nbsp;screen&nbsp;in&nbsp;the&nbsp;same&nbsp;spot,</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line336"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;the&nbsp;mouse&nbsp;events&nbsp;from&nbsp;the&nbsp;click&nbsp;will&nbsp;not&nbsp;be&nbsp;recorded.</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line337"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>now&nbsp;</span><span class="keyword operator js"><span>-</span></span><span>&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>lastTouchEndTime</span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="keyword operator comparison js"><span>&lt;</span></span><span>&nbsp;</span><span class="constant numeric decimal js"><span>1000</span></span><span class="meta brace round js"><span>)</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line338"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="punctuation definition function body end bracket curly js"><span>}</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line339"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line340"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta function json js"><span class="entity name function js"><span>onStart</span></span><span class="keyword operator assignment js"><span>:</span></span><span>&nbsp;</span><span class="storage type function js"><span>function</span></span><span>&nbsp;</span><span class="meta parameters js"><span class="punctuation definition parameters begin bracket round js"><span>(</span></span><span class="punctuation definition parameters end bracket round js"><span>)</span></span></span></span><span>&nbsp;</span><span class="punctuation definition function body begin bracket curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line341"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="storage type var js"><span>var</span></span><span>&nbsp;me&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable language js"><span>this</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line342"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;scrollerProto&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>getScrollerProto</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line343"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;scrollerFireEvent</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;scrollerFireScroll</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="support class js"><span>event</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line344"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line345"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>listeners</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="meta brace square js"><span>[</span><span>]</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line346"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line347"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="constant other object js"><span>ST</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>each</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>eventMaps</span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="meta function js"><span class="storage type function js"><span>function</span></span><span class="meta parameters js"><span class="punctuation definition parameters begin bracket round js"><span>(</span></span><span class="variable parameter function js"><span>events</span></span><span class="punctuation definition parameters end bracket round js"><span>)</span></span></span></span><span>&nbsp;</span><span class="punctuation definition function body begin bracket curly js"><span>{</span></span></span></span></span></span></span></div><div class="line"><a name="line348"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>for</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span class="support class js"><span>event</span></span><span>&nbsp;</span><span class="keyword operator in js"><span>in</span></span><span>&nbsp;events</span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></span></span></div><div class="line"><a name="line349"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>addListener</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="support class js"><span>event</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></span></span></div><div class="line"><a name="line350"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></span></span></div><div class="line"><a name="line351"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="punctuation definition function body end bracket curly js"><span>}</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line352"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line353"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;The&nbsp;standard&nbsp;event&nbsp;is&nbsp;&quot;wheel&quot;&nbsp;-&nbsp;fall&nbsp;back&nbsp;to&nbsp;&quot;mousewheel&quot;&nbsp;where&nbsp;not&nbsp;supported</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line354"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>addListener</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="constant other object js"><span>ST</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other object property js"><span>supports</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>Wheel</span></span><span>&nbsp;</span><span class="keyword operator js"><span>?</span></span><span>&nbsp;</span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>wheel</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span>&nbsp;</span><span class="keyword operator js"><span>:</span></span><span>&nbsp;</span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>mousewheel</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line355"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line356"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>scrollerProto</span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line357"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;If&nbsp;using&nbsp;a&nbsp;version&nbsp;of&nbsp;Ext&nbsp;that&nbsp;has&nbsp;a&nbsp;Ext.scroll.Scroller&nbsp;class&nbsp;(5.0+)</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line358"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;intercept&nbsp;the&nbsp;Scroller&#39;s&nbsp;scroll&nbsp;event&nbsp;to&nbsp;capture&nbsp;cross-platform</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line359"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;scroll&nbsp;events.&nbsp;&nbsp;We&nbsp;use&nbsp;a&nbsp;couple&nbsp;different&nbsp;techniques&nbsp;here&nbsp;depending&nbsp;on&nbsp;version</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line360"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;but&nbsp;we&nbsp;can&#39;t&nbsp;just&nbsp;listen&nbsp;to&nbsp;the&nbsp;use&nbsp;the&nbsp;global&nbsp;&#39;scroll&#39;&nbsp;event&nbsp;because&nbsp;that</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line361"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;was&nbsp;not&nbsp;introduced&nbsp;until&nbsp;version&nbsp;5.1.1</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line362"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line363"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span class="variable other object js"><span>scrollerProto</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>fireScroll</span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line364"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;5.1.0+&nbsp;only&nbsp;fires&nbsp;the&nbsp;scroll&nbsp;event&nbsp;from&nbsp;a&nbsp;fireScroll&nbsp;method</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line365"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;scrollerFireScroll&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>scrollerFireScroll</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>scrollerProto</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>fireScroll</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line366"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>scrollerProto</span></span><span class="meta function js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>fireScroll</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="storage type function js"><span>function</span></span><span class="meta parameters js"><span class="punctuation definition parameters begin bracket round js"><span>(</span></span><span class="variable parameter function js"><span>x</span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="variable parameter function js"><span>y</span></span><span class="punctuation definition parameters end bracket round js"><span>)</span></span></span></span><span>&nbsp;</span><span class="punctuation definition function body begin bracket curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line367"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>onScrollerScroll</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="variable language js"><span>this</span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;x</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;y</span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line368"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>scrollerFireScroll</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="support function js"><span>apply</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="variable language js"><span>this</span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="variable language js"><span>arguments</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line369"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="punctuation definition function body end bracket curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line370"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span><span>&nbsp;</span><span class="keyword control js"><span>else</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line371"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;5.0.0/5.0.1&nbsp;fires&nbsp;the&nbsp;scroll&nbsp;event&nbsp;from&nbsp;several&nbsp;different&nbsp;spots.</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line372"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;fortunately&nbsp;none&nbsp;of&nbsp;these&nbsp;have&nbsp;a&nbsp;check&nbsp;for&nbsp;hasListeners,&nbsp;so&nbsp;we&nbsp;can</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line373"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;just&nbsp;intercept&nbsp;fireEvent</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line374"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;scrollerFireEvent&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>scrollerFireEvent</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>scrollerProto</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>fireEvent</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line375"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>scrollerProto</span></span><span class="meta function js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>fireEvent</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="storage type function js"><span>function</span></span><span>&nbsp;</span><span class="meta parameters js"><span class="punctuation definition parameters begin bracket round js"><span>(</span></span><span class="variable parameter function js"><span>eventName</span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="variable parameter function js"><span>scroller</span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="variable parameter function js"><span>x</span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="variable parameter function js"><span>y</span></span><span class="punctuation definition parameters end bracket round js"><span>)</span></span></span></span><span>&nbsp;</span><span class="punctuation definition function body begin bracket curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line376"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>eventName&nbsp;</span><span class="keyword operator comparison js"><span>===</span></span><span>&nbsp;</span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>scroll</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line377"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>onScrollerScroll</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>scroller</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;x</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;y</span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line378"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line379"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>scrollerFireEvent</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="support function js"><span>apply</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>scroller</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="variable language js"><span>arguments</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line380"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="punctuation definition function body end bracket curly js"><span>}</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line381"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line382"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line383"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line384"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;We&nbsp;always&nbsp;listen&nbsp;for&nbsp;dom&nbsp;scroll&nbsp;events.&nbsp;&nbsp;This&nbsp;covers&nbsp;Ext&nbsp;&lt;&nbsp;5.0,&nbsp;or&nbsp;non-ext&nbsp;apps</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line385"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;where&nbsp;Ext.scroll.Scroller&nbsp;is&nbsp;not&nbsp;present&nbsp;as&nbsp;well&nbsp;as&nbsp;Ext&nbsp;5+&nbsp;apps&nbsp;where&nbsp;an&nbsp;element</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line386"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;is&nbsp;scrolled&nbsp;without&nbsp;an&nbsp;attached&nbsp;scroller&nbsp;(plain&nbsp;old&nbsp;overflow:auto)</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line387"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;In&nbsp;case&nbsp;we&nbsp;get&nbsp;duplicate&nbsp;scroll&nbsp;events,&nbsp;both&nbsp;from&nbsp;Ext.scroll.DomScroller&nbsp;and</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line388"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;from&nbsp;this&nbsp;scroll&nbsp;listener&nbsp;we&nbsp;will&nbsp;filter&nbsp;out&nbsp;the&nbsp;duplicate&nbsp;(see&nbsp;onEvent).</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line389"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>addListener</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>scroll</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line390"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="punctuation definition function body end bracket curly js"><span>}</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line391"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line392"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta function json js"><span class="entity name function js"><span>onStop</span></span><span class="keyword operator assignment js"><span>:</span></span><span>&nbsp;</span><span class="storage type function js"><span>function</span></span><span>&nbsp;</span><span class="meta parameters js"><span class="punctuation definition parameters begin bracket round js"><span>(</span></span><span class="punctuation definition parameters end bracket round js"><span>)</span></span></span></span><span>&nbsp;</span><span class="punctuation definition function body begin bracket curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line393"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="storage type var js"><span>var</span></span><span>&nbsp;me&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable language js"><span>this</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line394"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;scrollerProto&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>getScrollerProto</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line395"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line396"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="constant other object js"><span>ST</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>each</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>listeners</span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="meta function js"><span class="storage type function js"><span>function</span></span><span class="meta parameters js"><span class="punctuation definition parameters begin bracket round js"><span>(</span></span><span class="variable parameter function js"><span>listener</span></span><span class="punctuation definition parameters end bracket round js"><span>)</span></span></span></span><span>&nbsp;</span><span class="punctuation definition function body begin bracket curly js"><span>{</span></span></span></span></span></span></span></div><div class="line"><a name="line397"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>listener</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>destroy</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></span></span></div><div class="line"><a name="line398"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="punctuation definition function body end bracket curly js"><span>}</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line399"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line400"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>listeners</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="constant language null js"><span>null</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line401"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line402"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>scrollerProto</span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line403"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="punctuation whitespace comment leading js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span class="comment line double-slash js"><span class="punctuation definition comment js"><span>//</span></span><span>&nbsp;undo&nbsp;the&nbsp;changes&nbsp;to&nbsp;Ext.scroll.Scroller.prototype&nbsp;done&nbsp;by&nbsp;onStart()</span><span>&nbsp;</span></span></span></span></span></div><div class="line"><a name="line404"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span class="variable other object js"><span>scrollerProto</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>fireScroll</span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line405"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>scrollerProto</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>fireScroll</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>scrollerFireScroll</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line406"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>scrollerFireScroll</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="constant language null js"><span>null</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line407"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span><span>&nbsp;</span><span class="keyword control js"><span>else</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line408"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>scrollerProto</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>fireEvent</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>scrollerFireEvent</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line409"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>me</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>scrollerFireEvent</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="constant language null js"><span>null</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line410"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line411"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line412"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="punctuation definition function body end bracket curly js"><span>}</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line413"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line414"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta function json js"><span class="entity name function js"><span>getScrollerProto</span></span><span class="keyword operator assignment js"><span>:</span></span><span>&nbsp;</span><span class="storage type function js"><span>function</span></span><span class="meta parameters js"><span class="punctuation definition parameters begin bracket round js"><span>(</span></span><span class="punctuation definition parameters end bracket round js"><span>)</span></span></span></span><span>&nbsp;</span><span class="punctuation definition function body begin bracket curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line415"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="storage type var js"><span>var</span></span><span>&nbsp;Ext&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="support class js"><span>window</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>Ext</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line416"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;scroll&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;Ext&nbsp;</span><span class="keyword operator logical js"><span>&amp;&amp;</span></span><span>&nbsp;</span><span class="variable other object js"><span>Ext</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>scroll</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line417"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Scroller&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;scroll&nbsp;</span><span class="keyword operator logical js"><span>&amp;&amp;</span></span><span>&nbsp;</span><span class="variable other object js"><span>scroll</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>Scroller</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line418"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line419"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>return</span></span><span>&nbsp;Scroller&nbsp;</span><span class="keyword operator logical js"><span>&amp;&amp;</span></span><span>&nbsp;</span><span class="variable other object js"><span>Scroller</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant js"><span>prototype</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line420"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="punctuation definition function body end bracket curly js"><span>}</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line421"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line422"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line423"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta function json js"><span class="entity name function js"><span>locateElement</span></span><span class="keyword operator assignment js"><span>:</span></span><span>&nbsp;</span><span class="storage type function js"><span>function</span></span><span class="meta parameters js"><span class="punctuation definition parameters begin bracket round js"><span>(</span></span><span class="variable parameter function js"><span>element</span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="variable parameter function js"><span>ev</span></span><span class="punctuation definition parameters end bracket round js"><span>)</span></span></span></span><span>&nbsp;</span><span class="punctuation definition function body begin bracket curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line424"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="storage type var js"><span>var</span></span><span>&nbsp;targets&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="meta brace square js"><span>[</span><span>]</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line425"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strategies&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="variable language js"><span>this</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant js"><span>self</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>strategies</span></span><span class="meta delimiter object comma js"><span>,</span></span></span></span></span></div><div class="line"><a name="line426"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strategy</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;l</span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line427"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line428"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>for</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span>l&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="constant numeric decimal js"><span>0</span></span><span class="punctuation terminator statement js"><span>;</span></span><span>&nbsp;l&nbsp;</span><span class="keyword operator comparison js"><span>&lt;</span></span><span>&nbsp;</span><span class="variable other object js"><span>strategies</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant js"><span>length</span></span><span class="punctuation terminator statement js"><span>;</span></span><span>&nbsp;l</span><span class="keyword operator increment js"><span>++</span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></span></span></div><div class="line"><a name="line429"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strategy&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;strategies</span><span class="meta brace square js"><span>[</span></span><span>l</span><span class="meta brace square js"><span>]</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line430"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>strategy</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>locate</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>element</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;targets</span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;ev</span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line431"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line432"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;</span></span></span></span></div><div class="line"><a name="line433"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>return</span></span><span>&nbsp;targets</span><span class="punctuation terminator statement js"><span>;</span></span></span></span></span></div><div class="line"><a name="line434"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="punctuation definition function body end bracket curly js"><span>}</span></span></span></span></span></div><div class="line"><a name="line435"><span class="source js"><span class="meta method-call js"><span class="meta arguments js"><span class="meta brace curly js"><span>}</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></div><div class="line"><a name="line436"><span class="source js"><span>&nbsp;</span></span></div><div class="line"><a name="line437"><a name="ST-method-addLocatorStrategy"><span class="source js"><span class="comment block documentation js"><span class="punctuation definition comment js"><span>/**</span></span></span></span></div><div class="line"><a name="line438"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Registers&nbsp;a&nbsp;locator&nbsp;strategy&nbsp;for&nbsp;recording&nbsp;target&nbsp;locators.&nbsp;A&nbsp;locator&nbsp;strategy</span></span></span></div><div class="line"><a name="line439"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;implements&nbsp;a&nbsp;{@link&nbsp;ST.locator.Strategy#locate&nbsp;locate}&nbsp;method.&nbsp;If&nbsp;the&nbsp;`locator`</span></span></span></div><div class="line"><a name="line440"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;parameter&nbsp;is&nbsp;a&nbsp;function,&nbsp;it&nbsp;is&nbsp;treated&nbsp;as&nbsp;an&nbsp;implementation&nbsp;of&nbsp;such&nbsp;a&nbsp;method.</span></span></span></div><div class="line"><a name="line441"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line442"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;For&nbsp;example:</span></span></span></div><div class="line"><a name="line443"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line444"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ST.addLocatorStrategy(function&nbsp;(el,&nbsp;targets)&nbsp;{</span></span></span></div><div class="line"><a name="line445"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(el.id)&nbsp;{</span></span></span></div><div class="line"><a name="line446"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;targets.push(&#39;&gt;&gt;&nbsp;#&#39;&nbsp;+&nbsp;el.id);</span></span></span></div><div class="line"><a name="line447"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span></span></div><div class="line"><a name="line448"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});</span></span></span></div><div class="line"><a name="line449"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line450"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;The&nbsp;above&nbsp;locator&nbsp;strategy&nbsp;is&nbsp;not&nbsp;very&nbsp;useful,&nbsp;but&nbsp;illustrates&nbsp;the&nbsp;process</span></span></span></div><div class="line"><a name="line451"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;of&nbsp;adding&nbsp;new&nbsp;strategies.</span></span></span></div><div class="line"><a name="line452"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line453"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@method</span></span><span>&nbsp;addLocatorStrategy</span></span></span></div><div class="line"><a name="line454"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@member</span></span><span>&nbsp;ST</span></span></span></div><div class="line"><a name="line455"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;{ST.locator.Strategy/Function}&nbsp;strategy</span></span></span></div><div class="line"><a name="line456"><span class="source js"><span class="comment block documentation js"><span>&nbsp;</span><span class="punctuation definition comment js"><span>*/</span></span></span></span></div><div class="line"><a name="line457"><span class="source js"><span class="constant other object js"><span>ST</span></span><span class="meta function js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>addLocatorStrategy</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="storage type function js"><span>function</span></span><span>&nbsp;</span><span class="meta parameters js"><span class="punctuation definition parameters begin bracket round js"><span>(</span></span><span class="variable parameter function js"><span>strategy</span></span><span class="punctuation definition parameters end bracket round js"><span>)</span></span></span></span><span>&nbsp;</span><span class="punctuation definition function body begin bracket curly js"><span>{</span></span></span></div><div class="line"><a name="line458"><span class="source js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="keyword control js"><span>if</span></span><span>&nbsp;</span><span class="meta brace round js"><span>(</span></span><span class="keyword operator typeof js"><span>typeof</span></span><span>&nbsp;strategy&nbsp;</span><span class="keyword operator comparison js"><span>===</span></span><span>&nbsp;</span><span class="string quoted single js"><span class="punctuation definition string begin js"><span>&#39;</span></span><span>function</span><span class="punctuation definition string end js"><span>&#39;</span></span></span><span class="meta brace round js"><span>)</span></span><span>&nbsp;</span><span class="meta brace curly js"><span>{</span></span></span></div><div class="line"><a name="line459"><span class="source js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="storage type var js"><span>var</span></span><span>&nbsp;fn&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;strategy</span><span class="punctuation terminator statement js"><span>;</span></span></span></div><div class="line"><a name="line460"><span class="source js"><span>&nbsp;</span></span></div><div class="line"><a name="line461"><span class="source js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;strategy&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="meta class instance constructor"><span class="keyword operator new js"><span>new</span></span><span>&nbsp;</span><span class="entity name type instance js"><span>ST.locator</span></span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>Strategy</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></div><div class="line"><a name="line462"><span class="source js"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="variable other object js"><span>strategy</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>locate</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;fn</span><span class="punctuation terminator statement js"><span>;</span></span></span></div><div class="line"><a name="line463"><span class="source js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="meta brace curly js"><span>}</span></span></span></div><div class="line"><a name="line464"><span class="source js"><span>&nbsp;</span></span></div><div class="line"><a name="line465"><span class="source js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="constant other object js"><span>ST</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant dom js"><span>event</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other object property js"><span>Recorder</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other object property js"><span>strategies</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="support function js"><span>push</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span>strategy</span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></div><div class="line"><a name="line466"><span class="source js"><span class="punctuation definition function body end bracket curly js"><span>}</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></div><div class="line"><a name="line467"><span class="source js"><span>&nbsp;</span></span></div><div class="line"><a name="line468"><a name="ST-method-setLocatorStrategies"><span class="source js"><span class="comment block documentation js"><span class="punctuation definition comment js"><span>/**</span></span></span></span></div><div class="line"><a name="line469"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;Replaces&nbsp;the&nbsp;locator&nbsp;strategies&nbsp;with&nbsp;those&nbsp;provided&nbsp;to&nbsp;this&nbsp;call.&nbsp;For&nbsp;details&nbsp;on</span></span></span></div><div class="line"><a name="line470"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;locator&nbsp;strategy&nbsp;see&nbsp;{@link&nbsp;#addLocatorStrategy}.</span></span></span></div><div class="line"><a name="line471"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line472"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;The&nbsp;following&nbsp;call&nbsp;would&nbsp;produce&nbsp;the&nbsp;default&nbsp;strategies:</span></span></span></div><div class="line"><a name="line473"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line474"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ST.setLocatorStrategies(</span></span></span></div><div class="line"><a name="line475"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new&nbsp;ST.locator.Strategy()</span></span></span></div><div class="line"><a name="line476"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);</span></span></span></div><div class="line"><a name="line477"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line478"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;This&nbsp;method&nbsp;is&nbsp;used&nbsp;to&nbsp;control&nbsp;the&nbsp;presence&nbsp;and&nbsp;order&nbsp;of&nbsp;locator&nbsp;strategies.&nbsp;The&nbsp;order</span></span></span></div><div class="line"><a name="line479"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;is&nbsp;important&nbsp;to&nbsp;the&nbsp;`ST.event.Recorder`&nbsp;because&nbsp;the&nbsp;first&nbsp;locator&nbsp;strategy&nbsp;to&nbsp;produce</span></span></span></div><div class="line"><a name="line480"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;an&nbsp;element&nbsp;locator&nbsp;determines&nbsp;the&nbsp;default&nbsp;event&nbsp;{@link&nbsp;ST.event.Playable#target&nbsp;target}</span></span></span></div><div class="line"><a name="line481"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;and/or&nbsp;{@link&nbsp;ST.event.Playable#relatedTarget&nbsp;relatedTarget}.</span></span></span></div><div class="line"><a name="line482"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*</span></span></span></div><div class="line"><a name="line483"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@method</span></span><span>&nbsp;setLocatorStrategies</span></span></span></div><div class="line"><a name="line484"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@member</span></span><span>&nbsp;ST</span></span></span></div><div class="line"><a name="line485"><span class="source js"><span class="comment block documentation js"><span>&nbsp;*&nbsp;</span><span class="storage type class jsdoc"><span>@param</span></span><span>&nbsp;{ST.locator.Strategy/Function}&nbsp;strategy</span></span></span></div><div class="line"><a name="line486"><span class="source js"><span class="comment block documentation js"><span>&nbsp;</span><span class="punctuation definition comment js"><span>*/</span></span></span></span></div><div class="line"><a name="line487"><span class="source js"><span class="constant other object js"><span>ST</span></span><span class="meta function js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>setLocatorStrategies</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="storage type function js"><span>function</span></span><span>&nbsp;</span><span class="meta parameters js"><span class="punctuation definition parameters begin bracket round js"><span>(</span></span><span class="punctuation definition parameters end bracket round js"><span>)</span></span></span></span><span>&nbsp;</span><span class="punctuation definition function body begin bracket curly js"><span>{</span></span></span></div><div class="line"><a name="line488"><span class="source js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="constant other object js"><span>ST</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant dom js"><span>event</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other object property js"><span>Recorder</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other object property js"><span>strategies</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="support constant js"><span>length</span></span><span>&nbsp;</span><span class="keyword operator assignment js"><span>=</span></span><span>&nbsp;</span><span class="constant numeric decimal js"><span>0</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></div><div class="line"><a name="line489"><span class="source js"><span>&nbsp;</span></span></div><div class="line"><a name="line490"><span class="source js"><span>&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="constant other object js"><span>ST</span></span><span class="meta method-call js"><span class="meta delimiter method period js"><span>.</span></span><span class="entity name function js"><span>each</span></span><span class="meta arguments js"><span class="punctuation definition arguments begin bracket round js"><span>(</span></span><span class="variable language js"><span>arguments</span></span><span class="meta delimiter object comma js"><span>,</span></span><span>&nbsp;</span><span class="constant other object js"><span>ST</span></span><span class="meta delimiter property period js"><span>.</span></span><span class="variable other property js"><span>addLocatorStrategy</span></span><span class="punctuation definition arguments end bracket round js"><span>)</span></span></span></span><span class="punctuation terminator statement js"><span>;</span></span></span></div><div class="line"><a name="line491"><span class="source js"><span class="punctuation definition function body end bracket curly js"><span>}</span></span><span class="punctuation terminator statement js"><span>;</span></span></span></div></pre>
</body>
<script>
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
                (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
            m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

    ga('create', 'UA-1396058-28', 'auto');
    ga('send', 'pageview');

</script>
</html>
